import Vue from 'vue'
import App from './App.vue'
import router from './router'
// 导入全局样式表
import './assets/css/global.css'

// 手动配置element-ui
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

// 配置axios
import axios from 'axios'
axios.defaults.baseURL='http://127.0.0.1:8888/api/private/v1/'
// 配置axios请求拦截器
axios.interceptors.request.use(fig=>{
  // 为请求头对象添加token验证的Authorization字段
  fig.headers.Authorization = window.sessionStorage.getItem('token')
//  最后必须将fig return出去
  return fig
})
Vue.prototype.$http = axios



Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
